@extends('layouts.'.getTheme())
@section('title','获奖类型类别管理')
@section('css')
<link href="{{asset(getThemeAssets('css/toastr.min.css'))}}" rel="stylesheet">
<style type="text/css">
    .widget .row span{
      font-size: 15px;
      font-weight: bold;
    }
    .p-md{
        padding-top: 6px;
        padding-bottom: 0px;
        margin-top: 0px;
        margin-bottom: 30px;
    }
    .m-b-md{
        padding-top: 3px;
    }
    .page-heading{
        padding-bottom: 2px;
    }
    .alert{
        /*padding-bottom: 0px;*/
        padding-left: 23px;
        padding-right: 23px;
        margin-bottom: 0px;
    }
    .alert p{
        font-size: 14px;
        font-weight: 12px;
    }
    .alert a{
        text-decoration: underline;
    }
    .canceled{
        margin: 0;
        padding: 0;
    }
    #login-form {
        margin-top: 30px;
        margin-left: 0px;
        margin-right: 0px;
    }
    #login-form img{
        width: 100%;
        margin-left: 0;
    }
    #footerrow {
      margin-top: 100px;
    }
    .col-sm-6 {
      padding: 3px;
    }
</style>
@endsection
@section('content')

<div class="row wrapper border-bottom page-heading">
  <div class="col-sm-4">
    <h2>{!!trans('award.categoryTitle')!!}</h2>
    <ol class="breadcrumb">
        <li>
            <a href="{{url('admin')}}">{!!trans('home.title')!!}</a>
        </li>
        <li class="active">
            <strong>{!!trans('award.categoryTitle')!!}</strong>
        </li>
    </ol>
  </div>
</div>
<div id="login-form">
    <div class="logo">
        <img id="logo" src="{{asset(getThemeAssets('img/logo2.png'))}}">
    </div>
    <div class="row">
    <div class="col-sm-10 col-sm-offset-1 col-lg-10 col-lg-offset-1">
      <table class="table table-bordered" id="datatables" style="width:100%">
        <thead>
        <tr>
          <th>id</th>
          <th>获奖成果分类名称</th>
          <th>创建时间</th>
          <th>修改时间</th>
          <th>操作</th>
        </tr>
        </thead>
      </table>
    </div>
  </div>
</div>
                        

@endsection
@section('js')
<script src="{{asset(getThemeAssets('js/toastr.min.js'))}}"></script>
<script src="{{asset(getThemeAssets('dataTables/datatables.min.js', true))}}"></script>
<script src="{{asset(getThemeAssets('dataTables/vfs_fonts.js', true))}}"></script>
<script src="{{ asset(getThemeAssets('dataTables/buttons.colVis.min.js', true)) }}"></script>
<script src="{{ asset(getThemeAssets('dataTables/pdfmake.min.js', true)) }}"></script>
<script type="text/javascript">
    $(function () {
      var datatables = $('#datatables').DataTable({
        dom: 'Brtip',
        buttons: [
          {extend: 'colvis', text: '选择列'},
          {extend: 'csv', text: '导出csv文件'},
          {extend: 'excel', text: '导出excel文件'},
          {extend: 'pdf', text: '导出pdf文件'}
        ],   
        ordering: true,
        processing: true,
        serverSide: true,
        deferRender: true,
        pageLength: 50,
        ajax: "{{ url('/admin/award/categorydata') }}",
        columns: [
          {
            searchable: true,
            data: 'id',
            width: 150
          },
          {
            searchable: false,
            data: 'category_name',
            width: 150,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'create_time',
            width: 150,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: 'update_time',
            width: 150,
            render: function (data, type, row) {
              return data;
            }
          },
          {
            searchable: false,
            data: null,
            width: 150,
            render: function (data, type, row) {
                return '<a href="/' + row.id + '" class="btn btn-xs btn-info"><i class="fa fa-eye"></i></a> <a href="{{ url('/admin/awardcategory/edit') }}/' + row.id + '" class="btn btn-xs btn-warning"><i class="fa fa-edit"></i></a> <a href="{{ url('/admin/awardcategory/destroy') }}/' + row.id + '" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i></a>';
            }
          }
        ],
        initComplete: function () {
          this.api().columns([1]).every(function () {
            var column = this;
            var input = document.createElement('input');
            $(input).appendTo($(column.footer()).empty()).on('change', function () {
              column.search($(this).val(), false, false, true).draw();
            });
          });
        }
      });
    })
</script>
@endsection